package com.example.invoke;

import com.example.invoke.extend.service.ServiceFactoryBean;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.ImportResource;
import org.springframework.transaction.annotation.EnableTransactionManagement;

@ImportResource(locations = {"classpath:custom.xml"})
@SpringBootApplication
@EnableTransactionManagement
public class InvokeApplication {

    public static void main(String[] args) {
        System.setProperty("RUN_CONSUMER", "true");
        SpringApplication.run(InvokeApplication.class, args);
    }

    @Bean(name = "WSZ_TEST")
    public ServiceFactoryBean initBean () {
        ServiceFactoryBean bean = new ServiceFactoryBean();
        bean.setServiceId("WSZ_TEST");
        return bean;
    }
}
